﻿Public Class Create_new_Group

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Close()
    End Sub
    Private Sub CreateNewGroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CreateNewGroup.Click
        Module_stelios.connect()
        strsql = "INSERT INTO Groups (GroupName) values ( '" & Me.GroupName.Text & "')"

        Dim acscmd As New OleDb.OleDbCommand
        acscmd.CommandText = strsql
        acscmd.Connection = acsconn
        Dim rows As Integer
        rows = acscmd.ExecuteNonQuery
        If rows = 1 Then
            MsgBox("Επιτυχής εγγραφή Group name: " & Me.GroupName.Text)
            acscmd.Dispose()
            Me.Close()

        Else
            MsgBox(" Παρουσιάστηκε κάποιο σφάλμα ")

        End If

        acscmd.Dispose()
    End Sub
End Class